/*
csyingwu
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace Kaidou.Model
{

	/// <summary>
	/// Imst_union_branch interface for NHibernate mapped table 'mst_union_branch'.
	/// </summary>
	public interface Imst_union_branch
	{
		#region Public Properties
		
		mst_union_branchId Id
		{
			get ;
			set ;
		}
		
		string officename
		{
			get ;
			set ;
		}
		
		string officekana
		{
			get ;
			set ;
		}
		
		string officezipno
		{
			get ;
			set ;
		}

        string officezipno1
        {
            get;
            set;
        }

        string officezipno2
        {
            get;
            set;
        }
		
		short officeprefcode
		{
			get ;
			set ;
		}
		
		string officecity
		{
			get ;
			set ;
		}
		
		string officeaddress
		{
			get ;
			set ;
		}
		
		string officetel
		{
			get ;
			set ;
		}
		
		string officefax
		{
			get ;
			set ;
		}
		
		string officeemail
		{
			get ;
			set ;
		}
		
		string tantoname
		{
			get ;
			set ;
		}
		
		string tantokana
		{
			get ;
			set ;
		}
		
		string userclss
		{
			get ;
			set ;
		}
		
		string password
		{
			get ;
			set ;
		}
		
		string cancelrestflg
		{
			get ;
			set ;
		}
		
		string unionsts
		{
			get ;
			set ;
		}
		
		DateTime regdate
		{
			get ;
			set ;
		}
		
		DateTime upddate
		{
			get ;
			set ;
		}
		
		string updunioncode
		{
			get ;
			set ;
		}
		
		short updbranchcode
		{
			get ;
			set ;
		}
		
		string updfuncid
		{
			get ;
			set ;
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
		#region Serialize
		/// <summary>
		/// Method for entity class serialization to XML file
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to write to. Will be overwritten if already exists.</param>
		void SerializeToFile( string pXMLFilePath );
		
		/// <summary>
		/// Method for entity class deserialization from XML file. Does not change this object content but returns another deserialized object instance
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to read from.</param>
		/// <returns>mst_union_branch object restored from XML file</returns>
		mst_union_branch DeserializeFromFile( string pXMLFilePath );
		
		#endregion
		
		
	}

	/// <summary>
	/// mst_union_branch object for NHibernate mapped table 'mst_union_branch'.
	/// </summary>
	[Serializable]
	public class mst_union_branch : Imst_union_branch
	{
		#region Member Variables

		protected mst_union_branchId _id;
		protected string _officename;
		protected string _officekana;
		protected string _officezipno;
        protected string _officezipno1;
        protected string _officezipno2;
		protected short _officeprefcode;
		protected string _officecity;
		protected string _officeaddress;
		protected string _officetel;
		protected string _officefax;
		protected string _officeemail;
		protected string _tantoname;
		protected string _tantokana;
		protected string _userclss;
		protected string _password;
		protected string _cancelrestflg;
		protected string _unionsts;
		protected DateTime _regdate;
		protected DateTime _upddate;
		protected string _updunioncode;
		protected short _updbranchcode;
		protected string _updfuncid;
		protected bool _isDeleted;
		protected bool _isChanged;
		#endregion
		
		#region Constructors
		public mst_union_branch() {}
		
		public mst_union_branch(mst_union_branchId id, string officename, string officekana, string officezipno, short officeprefcode, string officecity, string officeaddress, string officetel, string officefax, string officeemail, string tantoname, string tantokana, string userclss, string password, string cancelrestflg, string unionsts, DateTime regdate, DateTime upddate, string updunioncode, short updbranchcode, string updfuncid)
		{
			this._id = id; /*id*/ 
			this._officename = officename; /*c*/ 
			this._officekana = officekana; /*c*/ 
			this._officezipno = officezipno; /*c*/ 
			this._officeprefcode = officeprefcode; /*c*/ 
			this._officecity = officecity; /*c*/ 
			this._officeaddress = officeaddress; /*c*/ 
			this._officetel = officetel; /*c*/ 
			this._officefax = officefax; /*c*/ 
			this._officeemail = officeemail; /*c*/ 
			this._tantoname = tantoname; /*c*/ 
			this._tantokana = tantokana; /*c*/ 
			this._userclss = userclss; /*c*/ 
			this._password = password; /*c*/ 
			this._cancelrestflg = cancelrestflg; /*c*/ 
			this._unionsts = unionsts; /*c*/ 
			this._regdate = regdate; /*c*/ 
			this._upddate = upddate; /*c*/ 
			this._updunioncode = updunioncode; /*c*/ 
			this._updbranchcode = updbranchcode; /*c*/ 
			this._updfuncid = updfuncid; /*c*/ 
		}
		
		#endregion
		
		
		
		#region Public Properties
		
		public mst_union_branchId Id
		{
			get { return _id; }
			set { _isChanged |= (_id != value); _id = value; }
		}
		
		public string officename
		{
			get { return _officename; }
			set { _isChanged |= (_officename != value); _officename = value; }
		}
		
		public string officekana
		{
			get { return _officekana; }
			set { _isChanged |= (_officekana != value); _officekana = value; }
		}
		
		public string officezipno
		{
			get { return _officezipno; }
			set { _isChanged |= (_officezipno != value); _officezipno = value; }
		}

        public string officezipno1
        {
            get { return _officezipno1; }
            set { _isChanged |= (_officezipno1 != value); _officezipno1 = value; }
        }

        public string officezipno2
        {
            get { return _officezipno2; }
            set { _isChanged |= (_officezipno2 != value); _officezipno2 = value; }
        }
		
		public short officeprefcode
		{
			get { return _officeprefcode; }
			set { _isChanged |= (_officeprefcode != value); _officeprefcode = value; }
		}
		
		public string officecity
		{
			get { return _officecity; }
			set { _isChanged |= (_officecity != value); _officecity = value; }
		}
		
		public string officeaddress
		{
			get { return _officeaddress; }
			set { _isChanged |= (_officeaddress != value); _officeaddress = value; }
		}
		
		public string officetel
		{
			get { return _officetel; }
			set { _isChanged |= (_officetel != value); _officetel = value; }
		}
		
		public string officefax
		{
			get { return _officefax; }
			set { _isChanged |= (_officefax != value); _officefax = value; }
		}
		
		public string officeemail
		{
			get { return _officeemail; }
			set { _isChanged |= (_officeemail != value); _officeemail = value; }
		}
		
		public string tantoname
		{
			get { return _tantoname; }
			set { _isChanged |= (_tantoname != value); _tantoname = value; }
		}
		
		public string tantokana
		{
			get { return _tantokana; }
			set { _isChanged |= (_tantokana != value); _tantokana = value; }
		}
		
		public string userclss
		{
			get { return _userclss; }
			set { _isChanged |= (_userclss != value); _userclss = value; }
		}
		
		public string password
		{
			get { return _password; }
			set { _isChanged |= (_password != value); _password = value; }
		}
		
		public string cancelrestflg
		{
			get { return _cancelrestflg; }
			set { _isChanged |= (_cancelrestflg != value); _cancelrestflg = value; }
		}
		
		public string unionsts
		{
			get { return _unionsts; }
			set { _isChanged |= (_unionsts != value); _unionsts = value; }
		}
		
		public DateTime regdate
		{
			get { return _regdate; }
			set { _isChanged |= (_regdate != value); _regdate = value; }
		}
		
		public DateTime upddate
		{
			get { return _upddate; }
			set { _isChanged |= (_upddate != value); _upddate = value; }
		}
		
		public string updunioncode
		{
			get { return _updunioncode; }
			set { _isChanged |= (_updunioncode != value); _updunioncode = value; }
		}
		
		public short updbranchcode
		{
			get { return _updbranchcode; }
			set { _isChanged |= (_updbranchcode != value); _updbranchcode = value; }
		}
		
		public string updfuncid
		{
			get { return _updfuncid; }
			set { _isChanged |= (_updfuncid != value); _updfuncid = value; }
		}
		

		public bool IsDeleted
		{
			get { return _isDeleted; }
			set { _isDeleted = value; }
		}
		
		public bool IsChanged
		{
			get { return _isChanged; }
			set { _isChanged = value; }

		}
		
		#endregion 
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			mst_union_branch castObj = null;
			try
			{
				castObj = (mst_union_branch)obj;
			} catch(Exception) { return false; } 
			return (castObj != null) && 
				this._id.Equals( castObj.Id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _id.GetHashCode();/*id*/
			return hash; 
		}
		#endregion
		
		#region Serialize
		/// <summary>
		/// Method for entity class serialization to XML file
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to write to. Will be overwritten if already exists.</param>
		public virtual void SerializeToFile( string pXMLFilePath )
		{
			System.Xml.Serialization.XmlSerializer seriliaser = new System.Xml.Serialization.XmlSerializer( this.GetType() );
			using(System.IO.TextWriter txtWriter = new System.IO.StreamWriter( pXMLFilePath ))
			{
				seriliaser.Serialize(txtWriter, this);
				txtWriter.Close();
			}
		}
		/// <summary>
		/// Method for entity class deserialization from XML file. Does not change this object content but returns another deserialized object instance
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to read from.</param>
		/// <returns>mst_union_branch object restored from XML file</returns>
		public virtual mst_union_branch DeserializeFromFile( string pXMLFilePath )
		{
			mst_union_branch _result = null;
			
			System.Xml.Serialization.XmlSerializer seriliaser = new System.Xml.Serialization.XmlSerializer( this.GetType() );
			using(System.IO.TextReader txtReader = new System.IO.StreamReader( pXMLFilePath ))
			{
				_result = (mst_union_branch)seriliaser.Deserialize( txtReader );
				txtReader.Close();
			}
			return _result;
		}
		#endregion
		
		
	}
	
	#region Custom ICollection interface for mst_union_branch 

	
	public interface Imst_union_branchCollection : ICollection
	{
		mst_union_branch this[int index]{	get; set; }
		void Add(mst_union_branch pmst_union_branch);
		void Clear();
	}
	
	[Serializable]
	public class mst_union_branchCollection : Imst_union_branchCollection
	{
		private IList<mst_union_branch> _arrayInternal;

		public mst_union_branchCollection()
		{
			_arrayInternal = new List<mst_union_branch>();
		}
		
		public mst_union_branchCollection( IList<mst_union_branch> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<mst_union_branch>();
			}
		}

		public mst_union_branch this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((mst_union_branch[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(mst_union_branch pmst_union_branch) { _arrayInternal.Add(pmst_union_branch); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<mst_union_branch> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
